/*
 *
 * *******************************************************************
 *   @项目名称: BHex Android
 *   @文件名称: UpdateConfig.java
 *   @Date: 11/29/18 3:21 PM
 *   @Author: chenjun
 *   @Copyright（C）: 2018 BlueHelix Inc.   All rights reserved.
 *   注意：本内容仅限于内部传阅，禁止外泄以及用于其他的商业目的.
 *  *******************************************************************
 *
 */

package io.bhex.baselib.update;

import android.content.Context;

import io.bhex.baselib.utils.SP;

/**
 * 更新相关设置
 */
public class UpdateConfig {
    private static boolean updateOnlyOnWifi = false;
    private static boolean updateForce = false;
    private static String KEY_IGNORED_UPDATE = "ignored_update";

    public static boolean isUpdateOnlyOnWifi() {
        return updateOnlyOnWifi;
    }

    public static void setUpdateOnlyOnWifi(boolean updateOnlyOnWifi) {
        UpdateConfig.updateOnlyOnWifi = updateOnlyOnWifi;
    }

    public static boolean isUpdateForce() {
        return updateForce;
    }

    public static void setUpdateForce(boolean updateForce) {
        UpdateConfig.updateForce = updateForce;
    }

    public static void saveIgnoredMd5(Context context, String md5) {
        SP.set(KEY_IGNORED_UPDATE, md5);
    }

    public static String getIgnoredMd5(Context context) {
        return SP.get(KEY_IGNORED_UPDATE, "");
    }

}
